﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Toolkit.Controls">

	<Style TargetType="local:Tile">
		<Setter Property="Background" Value="{StaticResource DefaultAccentBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}"/>
		<Setter Property="FontSize" Value="{StaticResource DefaultFontSizeNormal}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:Tile">
					<Grid Name="root" Background="{TemplateBinding Background}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver" />
								<VisualState x:Name="Pressed" />
								<VisualState x:Name="PointerOver" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="titleText">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultContrastDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="contentContainer">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultContrastDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="root">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						
						<ContentControl
							Name="contentContainer"
							HorizontalContentAlignment="Stretch"
							VerticalContentAlignment="Stretch"
                            Content="{TemplateBinding Content}" />
						<!-- 
							Label is an object but TextWrapping is TextBlock Only
							... this could blow up 
						-->
						<TextBlock
							Name="titleText"
                            TextWrapping="{TemplateBinding TextWrapping}"
							FontSize="{TemplateBinding FontSize}"
							FontFamily="{TemplateBinding FontFamily}"
                            VerticalAlignment="Bottom"
                            Padding="12, 0"
                            Margin="0, 0, 0, 7"
                            Text="{TemplateBinding Label}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>